<?php
/**
 * Prado Portal.
 *
 * @author Steen Rabol <steen.rabol@gmail.com>
 * @link http://www.pradoportal.dk/
 * @copyright Copyright &copy; 2006,2007,2008 Steen Rabol
 * @license http://www.pradoportal.dk
 * @version $Id: PortalDbLogRoute.php 289 2008-11-14 05:34:40Z steen.rabol@gmail.com $
 * @package Pradoportal.Common
 *
 */

/**
 *
 * @package Pradoportal.Common
 */
Prado::using('Application.Common.Data.PortalLogRecord');

class PortalDbLogRoute extends TLogRoute
{
	public function processLogs($logs)
	{
		$db	= $this->Application->DbConnection;

		if($db !== null)
		{
			foreach($logs as $log)
			{
				$lrec	= new PortalLogRecord();
				$lrec->logtime	= $log[3];
				$lrec->loglevel	= $this->getLevelName($log[1]);
				$lrec->category	= $log[2];
				$lrec->message	= $log[0];
				$lrec->save();
			}
		}
	}
}

?>